//
//  SecondBrandCell.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/29.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "SecondBrandCell.h"
#import "CommonMacro.h"

@interface SecondBrandCell()
@property (nonatomic,strong) UIView *bgView;
@property (nonatomic,strong) UIView *topView;
@property (nonatomic,strong) UIView *smallModulView;
@end
@implementation SecondBrandCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createBrandSpecilSubview];
    }
    return self;
}

- (void)createBrandSpecilSubview
{
    //1.大背景
    self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT*0.14)];
    [self addSubview:self.bgView];
    //    self.bgView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"商品底框"]];
    self.bgView.backgroundColor = UIColorWithRGBA(255, 255, 255, 1);
    
    //2.标题
    self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.frame.size.width, self.bgView.frame.size.height*0.4)];
    [self.bgView addSubview:self.topView];
    self.topView.backgroundColor = UIColorWithRGBA(248, 111, 150, 1);
    //2.1
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, self.topView.frame.size.width*0.25,self.topView.frame.size.height-10)];
    [self.topView addSubview:self.titleLabel];
    self.titleLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"主标题深底色"]];
//    self.titleLabel.text = @"niha";
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.textColor = UIColorWithRGBA(253, 240, 243, 1);
    
    //3.图片 品牌
    CGFloat viewY = self.topView.frame.size.height+self.topView.frame.origin.y+10;
    CGFloat viewW = self.topView.frame.size.width*0.3;
    CGFloat viewH = self.bgView.frame.size.height*0.8;
    self.smallModulView = [[UIView alloc] initWithFrame:CGRectMake(10,viewY,viewW,viewH)];
    [self.bgView addSubview:self.smallModulView];

    //3.1
    self.brandImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.smallModulView.frame.size.width, self.smallModulView.frame.size.height*0.6)];
    [self.smallModulView addSubview:self.brandImageView];
    self.brandImageView.layer.cornerRadius = 5;
    self.brandImageView.clipsToBounds = YES;
    self.brandImageView.layer.borderColor = UIColorWithRGBA(229, 229, 229, 1).CGColor;
    self.brandImageView.layer.borderWidth = 1;

    //3.2
    self.brandTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.brandImageView.frame.size.height+self.brandImageView.frame.origin.y, self.smallModulView.frame.size.width, self.smallModulView.frame.size.height*0.4)];
    [self.smallModulView addSubview:self.brandTitleLabel];
    self.brandTitleLabel.textColor = UIColorWithRGBA(125, 125, 125, 1);
    self.brandTitleLabel.textAlignment = NSTextAlignmentCenter;
    self.brandTitleLabel.font = [UIFont boldSystemFontOfSize:12];
    //4.
    
}

@end
